var isArrayLike = require("./15_isArrayLike");
var findIndex = require("./21_findIndex");
var findKey = require("./22_findKey");

function find(obj, predicate, context) {
  var key;
  if (isArrayLike(obj)) {
    key = findIndex(obj, predicate, context);
  } else {
    key = findKey(obj, predicate, context);
  }
  if (key !== void 0 && key !== -1) {
    return obj[key];
  }
}

module.exports = find;
